namespace Live2D.Cubism.Core.Unmanaged
{
	public static unsafe class IntPointerUtil
	{
		public static int[] SumList(int* self, int count, int[] list = null)
		{
			if (list == null)
			{
				list = new int[count];
			}
			var sum = 0;
			for (var i = 0; i < count; i++)
			{
				list[i] = sum;
				var it = self[i];
				sum += it;
			}
			return list;
		}
		public static int Sum(int* self, int count)
		{
			var sum = 0;
			for (var i = 0; i < count; i++)
			{
				var it = self[i];
				sum += it;
			}

			return sum;
		}

	}
}